package com.mdhw.system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.mdhw.common.base.PageData;
import com.mdhw.config.R;
import com.mdhw.system.entity.SysRole;
import com.mdhw.system.vo.SysMenuTree;
import com.mdhw.system.vo.SysRoleVo;
import com.mdhw.system.vo.SysUserVo;

import java.util.List;
import java.util.Map;

/**
* @author Huang
* @date 2022-03-14
*/
public interface SysRoleService extends IService<SysRole> {

    public R<PageData<SysRoleVo>> selectListPage(Long pageNo,Long pageSize,String name,String code);

    public R<String> addRole(SysRole sysRole);

    public R<String> updateRole(SysRole sysRole);

    public R<String> deleteRole(Long id);

    /**
     * 设置角色菜单
     * @param sysRoleVo
     * @return
     */
    R<String> setRoleMenu(SysRoleVo sysRoleVo);

    /**
     * 查询菜单树通过
     * @param id
     * @return
     */
    R<Map<String,Object>> selectMenuTreeByRoleId(Long id);

    /**
     * 查询角色全部列表
     * @param name
     * @param type
     * @return
     */
    R<List<SysRole>> selectAllList(String name,String type);


    public R<SysRoleVo> selectSysRoleVoByUserId(Long userId);

    public Boolean isCanShenheZxTopUp(Long userId);
}
